/******************************************************************************
** 
** Binary search.
** 
** File name:	binsearch.c
** Compilation:	cc binsearch.c -o binsearch
** Execution:	./binsearch
** 
** Description:
** Searches the position of an element in the sorted array.
** 
******************************************************************************/
#include <stdio.h>
#include "myfunctions.h"

int main()
{
    // 25 first prime numbers:
    unsigned short int data[25] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
    
    printf("Element \"%d\" is in position %d.\n", 431, BinSearch(37, data, 25));
    
    return 0;
}
